#include <iostream>
#include <stdio.h>
using namespace std;

int main()
{
    int num = 0,sum=0,temp;
    int OuM[10];
    while (num<=10){}
        cin<<

        if(In==0)
            break;      
        while(1)
        {
            if (temp<2)
                break;
            if (temp==2)
                sum = sum + 1;
        }
            sum = sum + floor(temp/3);
            temp = floor(temp/3) + mod(temp,3);

        num = num + 1;
        OuM(num) = sum;


        fprintf('%d\n',OuM(num));
    }
    system("pause");
    return 0;
}
